// web/src/app/(employee)/company/page.tsx
import React from 'react';
import CompanyNavbar from "@/app/(employee)/company/[id]/_components/company-navbar";
import CompanyContent from "@/app/(employee)/company/[id]/_components/company-content";
import {db} from "@/lib/db";
import {Company, Employee, Hr} from "@prisma/client";

const Page = async ({
                        params
                    }: {
    params: { id: string }
}) => {
    const id = params.id;
    const company = await db.company.findUnique({
        where: {id},
        include: {
            Hr: true,
            Employee: {
                include: {
                    education: true,
                    tags: true,
                    city: true,
                    company: true,
                    hr: true
                }
            }
        }
    })

    return (
        <div className={`h-full pb-4 bg-sky-200/20`}>
            <CompanyNavbar company={company as Company & {
                Hr: Hr[],
                Employee: Employee[]
            }}/>
            {/*@ts-ignore*/}
            <CompanyContent company={company as Company}/>
        </div>
    );
};


export default Page;